package com.example.bindservice;

import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;

import androidx.appcompat.app.AppCompatActivity;

public class Music extends AppCompatActivity implements View.OnClickListener {

    private TextView textView;
    private Button button_start;
    private Button button_pause;
    private Button button_stop;
    private Button button_exit;


    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_music);
        initView();
    }

    private void initView() {
        textView = (TextView) findViewById(R.id.textView);
        button_start = (Button) findViewById(R.id.button_start);
        button_pause = (Button) findViewById(R.id.button_pause);
        button_stop = (Button) findViewById(R.id.button_stop);
        button_exit = (Button) findViewById(R.id.button_exit);

        button_start.setOnClickListener(this);
        button_pause.setOnClickListener(this);
        button_stop.setOnClickListener(this);
        button_exit.setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        button_start.setBackgroundColor(getResources().getColor(R.color.greenyellow));
        button_pause.setBackgroundColor(getResources().getColor(R.color.greenyellow));
        button_stop.setBackgroundColor(getResources().getColor(R.color.greenyellow));
        button_exit.setBackgroundColor(getResources().getColor(R.color.greenyellow));
        switch (v.getId()) {
            case R.id.button_start:
                button_start.setBackgroundColor(getResources().getColor(R.color.darkseagreen));


                break;
            case R.id.button_pause:
                button_pause.setBackgroundColor(getResources().getColor(R.color.darkseagreen));


                break;
            case R.id.button_stop:
                button_stop.setBackgroundColor(getResources().getColor(R.color.darkseagreen));


                break;
            case R.id.button_exit:
                button_exit.setBackgroundColor(getResources().getColor(R.color.darkseagreen));


                break;
        }
    }
}
